<h2 class="jquery_tab_title">用户管理</h2>
<input type='hidden' id='user_num' value='<?php echo $user_num ?>'/>
<input type='hidden' id='per_page' value='<?php echo PER_PAGE ?>'/>
<form class='um' id='search_form'>
	<span>关键字：<input class='input-small' type='text' value='<?php echo $keywords ?>' id='keywords'/></span>
	
	<script>
	//给下拉菜单绑值
	$(function() {
		var function_array = getAllAssociationFunction();
		for (var i= 0; i < function_array.length; i++) {
			$('#function_FLAG').append("<option value=" + i + ">" + function_array[i] + "</option>");
		}
		<?php if ($function_FLAG != ''):?>
		$('#function_FLAG option').each(function() {
			if($(this).val() == <?php echo $function_FLAG + "" ?>) {
				$(this).attr("selected", "selected");
			}
		});
		<?php endif;?>
	});
	</script>
	<span>
	帐号类型：
	<select id='function_FLAG' onchange="($(this).val() == '' || $(this).val() == <?php echo IS_FUNCTION ?>) ? $('#confirm_FLAG').parent().css({'display': 'none'}) : $('#confirm_FLAG').parent().css({'display': 'inline'})">
		<option value="">请选择</option>
	</select>
	</span>
	
	<script>
	//给下拉菜单绑值
	$(function() {
		var status_array = getAllAssociationStatus();
		for (var i= 0; i < status_array.length; i++) {
			$('#confirm_FLAG').append("<option value=" + i + ">" + status_array[i] + "</option>");
		}
		<?php if ($confirm_FLAG != ''):?>
		$('#confirm_FLAG option').each(function() {
			if($(this).val() == <?php echo $confirm_FLAG + "" ?>) {
				$(this).attr("selected", "selected");
			}
		});
		<?php endif;?>
		<?php if ($function_FLAG == NOT_FUNCTION && $function_FLAG != ''):?>
		$('#confirm_FLAG').parent().css({'display': 'inline'})
		<?php endif;?>
	});
	</script>
	<span style='display: none;'>
	帐号状态：
	<select id='confirm_FLAG' >
		<option value="">请选择</option>
	</select>
	</span>
	
	<input class='button' id='search_submit' type='button' value='查询'/>
	
	<input class='button' id='create_new' type='button' value='添加功能账号'/>
	
	<div id='um_creat_newer_dialog' title='给您的部门增加功能账号'>
	<p>
		<span>用户名</span>
		<input class='input-small' type='text' value='' id='user_name'/>
	</p>
	<p>
		<span>&nbsp;&nbsp;&nbsp;密码</span>
		<input class='input-small' type='text' value='' id='password'/>
	</p>
	<div id='create_msg'></div>
	</div>
	<script>
	$("#um_creat_newer_dialog").dialog({
		autoOpen: false,
		resizable: false,
		draggable: false,
		width: 300,
		height: 250,
		modal: true,
		buttons: {
			"确定": function() {
				var user_name = $("#um_creat_newer_dialog #user_name").val();
				var password = $("#um_creat_newer_dialog #password").val();
				
				Admin.um.create(user_name, password, '');
				$(this).ajaxComplete(function(){
					if (Admin.um.create_is_succeed == true) {
						$( this ).dialog( "close" );
					}
				});
			},
			"取消": function() {
				$( this ).dialog( "close" );
			}
		}
	});
	</script>
</form><br />
<?php if ($user_num > 0):?>
<table id='table_liquid' cellspacing='0'>
	<caption>查询到相关账户<?php echo $user_num ?>个</caption>
	<tr>
	<th class='nobg'>UID</th>
	<th>姓名</th>
	<th>性别</th>
	<th>出生年月</th>
	<th>联系方式</th>
	<th>账户状态</th>
	<th>账户操作</th>
	</tr>
	
	<?php foreach ($user_info as $v):?>
	<?php if ($v['function_FLAG'] == NOT_FUNCTION):?>
	<tr>
	<th class='specalt'><?php echo $v['employee_id']?></th>
	<td class='alt'><?php echo $v['a_name']?></td>
	<td class='alt'><?php echo $this->common_data->_get_gender_by_cid($v['a_gender'])?></td>
	<td class='alt'><?php echo $this->common->convert_birthday($v['a_birth'])?></td>
	<td class='alt'><?php echo $v['a_phone']?></td>
	<td class='alt <?php echo ($v['confirm_FLAG'] != ASSOCIATION_VERIFY_PASS) ? 'tip' : ''?>'><?php echo $this->common_data->_get_association_status_by_confirm_flag($v['confirm_FLAG'])?></td>
	<td class='alt'>
		<span><a id='<?php echo $v['employee_id']?>' class='um modify'>修改</a> | <a id='<?php echo $v['employee_id']?>' class='um delete'>删除</a></span>
	</td>
	</tr>
	<?php else :?>
	<tr>
	<th class='specalt'><?php echo $v['employee_id']?></th>
	<td class='alt'>功能账号</td>
	<td class='alt'>-</td>
	<td class='alt'>-</td>
	<td class='alt'>-</td>
	<td class='alt'>-</td>
	<td class='alt'>
		<span><a id='<?php echo $v['employee_id']?>' class='um modify'>修改</a> | <a id='<?php echo $v['employee_id']?>' class='um delete'>删除</a></span>
	</td>
	</tr>
	<?php endif;?>
	<?php endforeach;?>
</table>
<div id='Pagination' style='display: none;'></div>
<?php else :?>
<strong id='error_msg' style='background: url(/admin_style/images/attention.png) no-repeat; color: #f60;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;悲剧了，没有找到您要的查询结果</strong>
<?php endif;?>